﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Data.SqlClient;

namespace QA_System
{
    class databaseConnection
    {
        public static string getConnectionString()
        {
            string ConnString = null;
            ConnString = QA_System.Properties.Settings.Default.QASysConnectionString.ToString();
            if (ConnString != null) return ConnString;
            else return null;
            }
        public static SqlConnection openConnection(string connectionString)
        {
            try
            {
                SqlConnection conn = new SqlConnection(connectionString);
                return conn;
            }
            catch (SqlException ex)
            {
                throw (ex);
            }
        }

        public static void closeConnection(SqlConnection conn)
        {
            conn.Close();
        }
    }
}
